
import java.io.File;
import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;


import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;


import com.felight.db.DbManager;
import com.felight.examples.io.FileApiDemo;
import com.flamboyanz.utils.Calculator;


public class Test {
		static Logger log = Logger.getLogger(Test.class.getName());


		public static void main(String[] felight) {
			
		String s;
		/*
		//File & io test
		File f1 = new File("test.txt");
		
		FileApiDemo.writeSomething(f1, "Something");
		
		try {
			FileApiDemo.readTheFile(f1);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}*/
		
		
		/*PropertyConfigurator.configure("log4j.properties");
		
		//System.out.println("start");
		*/
			
			
		DbManager dbmanager = new DbManager();
		
		//log.debug("going to execute a query");
		ResultSet rs = dbmanager.select("select * from students");
			try {
				while(rs.next()) {
					System.out.println(" " + rs.getString(1) + " " + rs.getString(2));
					//System.out.println(" " + rs.getString(0) + " " + rs.getString(1));
				}
			} catch (SQLException e) {
				log.error(e.toString());
			}
			finally {
				dbmanager.closeResource();
			}
		
		
	}
}